# 作者：小七
# 2024年12月27日

# my_list = []
#
# for i in range(10):
#     my_list.append(i)
# print(my_list)

my_list = [x for x in range(10)]

print(my_list)

a = [j for i in range(10) for j in range(i)]
print(a)

a = [[col*row for col in range(5)] for row in range(5)]
print(a)

b = [j for x in a for j in x]
print(b)

c = [x for x in range(10) if x % 2 == 0]
print(c)

d = [x if x % 2 == 0 else x ** 2 for x in range(10)]
print(d)